package com.qf.kdxf.controller;

import com.qf.kdxf.entity.ResultData;
import com.qf.kdxf.service.NaturalLanguageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author 明廷盛
 * @Date 2025/6/16 18:15
 * @Description
 */
@Controller
@RequestMapping("/naturalLanguage")
public class NaturalLanguageController {

    @Autowired
    private NaturalLanguageService languageService;

    /**
     *  01-机器语言翻译
     * @param from  源语种
     * @param to 目标语种
     * @param text 文本内容
     * @return
     */

    @RequestMapping("/translation")
    @ResponseBody
    public ResultData translation(String from, String to, String text){
        System.out.println(from+to+text);

        ResultData result =  languageService.getTranlation(from,to,text);


        return result;
    }
}

